package com.refusea.train.controller

import com.refusea.train.domain.entity.User
import com.refusea.train.domain.helper.StudentHelper
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/4/4
 **/
@RestController
@RequestMapping("/api/private/student")
class StudentController(private val studentHelper: StudentHelper) {

    @GetMapping("/list")
    fun list(): List<User> {
        return studentHelper.list()
    }

    @GetMapping("/ungrouped")
    fun ungrouped(courseId: Int): List<User> {
        return studentHelper.ungrouped(courseId)
    }
    @GetMapping("/children")
    fun children(): List<User> {
        return studentHelper.children()
    }
}
